package com.itheima.object_oriented;

import java.lang.reflect.Array;
import java.util.Arrays;

public class Test1 {
    public static void main(String[] args) {
        int[] arr = {10, 20, 30, 40, 50};
        //面向过程
        for (int i = 0; i < arr.length; ++i) {
            int e = arr[i];
            if(i == 0 ){
                System.out.print("["+e+", ");
            }else if(i == arr.length -1){
                System.out.println(e+"]");
            }else{
                System.out.print(e+", ");
            }
        }
        //面向对象
        System.out.println(Arrays.toString(arr));
    }
}
